// uno.config.ts
import {defineConfig} from 'unocss'

export default defineConfig({
    rules: [
        [/^m-([\.\d]+)$/, ([_, num]) => ({margin: `${num}px`})],
        [/^mt-([\.\d]+)$/, ([_, num]) => ({'margin-top': `${num}px`})],
        [/^mb-([\.\d]+)$/, ([_, num]) => ({'margin-bottom': `${num}px`})],
        [/^ml-([\.\d]+)$/, ([_, num]) => ({'margin-left': `${num}px`})],
        [/^mr-([\.\d]+)$/, ([_, num]) => ({'margin-right': `${num}px`})],
        [/^p-([\.\d]+)$/, ([_, num]) => ({padding: `${num}px`})],
        [/^pt-([\.\d]+)$/, ([_, num]) => ({'padding-top': `${num}px`})],
        [/^pb-([\.\d]+)$/, ([_, num]) => ({'padding-bottom': `${num}px`})],
        [/^pl-([\.\d]+)$/, ([_, num]) => ({'padding-left': `${num}px`})],
        [/^pr-([\.\d]+)$/, ([_, num]) => ({'padding-right': `${num}px`})],
        [/^w-([\.\d]+)$/, ([_, num]) => ({'width': `${num}px`})],
        [/^h-([\.\d]+)$/, ([_, num]) => ({'height': `${num}px`})],
        [/^wp-([\.\d]+)$/, ([_, num]) => ({'width': `${num}%`})],
        [/^hp-([\.\d]+)$/, ([_, num]) => ({'height': `${num}%`})],
        [/^fs-([\.\d]+)$/, ([_, num]) => ({'font-size': `${num}px`})],
        [/^color-([\.A-Za-z0-9]+)$/, ([_, color]) => ({'color': `${color}`})],
        [/^color-#([\.A-Za-z0-9]+)$/, ([_, color]) => ({'color': `#${color}`})],
        [/^bg-color-([\.A-Za-z0-9]+)$/, ([_, color]) => ({'background-color': `${color}`})],
        [/^display-([\.A-Za-z0-9]+)$/, ([_, display]) => ({'display': `${display}`})],
        [/^position-([\.A-Za-z0-9]+)$/, ([_, position]) => ({'position': `${position}`})],
        ['text-center', {'text-align': 'center'}],
    ]
})